const arr=[1,2,3,4,5,6,7,8,9];
// let sum=0;
let sum=arr.reduce((last,value)=> last+value,0);  // 不会改变原来的数组
console.log(arr);
console.log(sum);